package com.sc.test.databinding;

import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;


/**
 * Created by Shen Chao.
 * Created on 2018-06-14-014.
 */
public class DataBindingActivity extends AppCompatActivity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //todo 问题需要处理
//        com.sc.test.databinding.ActivityDatabindingBinding binding =
//                DataBindingUtil.setContentView(this, R.layout.activity_databinding);
//        Dog dog = new Dog();
//        dog.setAge("2");
//        dog.setName("哈士奇");
//        binding.setDog(dog);
//        binding.setVariable(BR.dog, dog);
//        binding.setPersenter(new Persenter());
    }


    class Persenter {
        public void onClick(View view) {
            Toast.makeText(DataBindingActivity.this, "点击", Toast.LENGTH_SHORT).show();
        }

        public void onClick2(Dog dog) {
            Toast.makeText(DataBindingActivity.this, "被点击了", Toast.LENGTH_SHORT).show();
        }
    }
}
